package com.jl.jlapp.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.text.TextPaint;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestBuilder;
import com.bumptech.glide.RequestManager;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jl.jlapp.R;
import com.jl.jlapp.eneity.ActivityInformationByIdModel;
import com.jl.jlapp.eneity.ActivityInformationByIdModel.ResultDataBean.GoodsBean;
import com.jl.jlapp.eneity.ActivityInformationByIdModel.ResultDataBean.GoodsBean.GoodsSpecificationDetailsBean;
import com.jl.jlapp.eneity.ActivityInformationByIdModel.ResultDataBean.GoodsBean.GoodsSpecificationDetailsBean.GoodsDisplayPicturesBean;

import java.util.List;

public class ActivityNameGoodsListAdapter
        extends BaseQuickAdapter<GoodsBean, BaseViewHolder> {
    public ActivityNameGoodsListAdapter(@LayoutRes int paramInt, @Nullable List<GoodsBean> paramList) {
        super(paramInt, paramList);
    }

    protected void convert(BaseViewHolder paramBaseViewHolder, GoodsBean paramGoodsBean) {
        String str = ((GoodsDisplayPicturesBean) ((GoodsSpecificationDetailsBean) paramGoodsBean.getGoodsSpecificationDetails().get(0)).getGoodsDisplayPictures().get(0)).getPicUrl();
        ImageView localImageView = (ImageView) paramBaseViewHolder.getView(R.id.goods_img);
        TextView localTextView = (TextView) paramBaseViewHolder.getView(R.id.old_goods_price);
        localTextView.getPaint().setFlags(16);
        paramBaseViewHolder.setText(R.id.goods_name, paramGoodsBean.getName());
        paramBaseViewHolder.setText(R.id.goods_price, ((GoodsSpecificationDetailsBean) paramGoodsBean.getGoodsSpecificationDetails().get(0)).getPrice() + "");
        if (((GoodsSpecificationDetailsBean) paramGoodsBean.getGoodsSpecificationDetails().get(0)).getOldPrice() > 0.0D) {
            localTextView.setVisibility(View.VISIBLE);
            paramBaseViewHolder.setText(R.id.old_goods_price, "¥" + ((GoodsSpecificationDetailsBean) paramGoodsBean.getGoodsSpecificationDetails().get(0)).getOldPrice());
        }
        while ((str == null) || (str == "")) {
            Glide.with(paramBaseViewHolder.itemView.getContext()).asBitmap().apply(new RequestOptions().placeholder(R.drawable.img_noimg_xss).error(R.drawable.img_noimg_xss)).load(R.drawable.img_noimg_xss).into(localImageView);
            localTextView.setVisibility(View.GONE);
            return;
        }
        Glide.with(paramBaseViewHolder.itemView.getContext()).asBitmap().apply(new RequestOptions().placeholder(R.drawable.img_lose_xss).error(R.drawable.img_lose_xss)).load("http://117.158.178.202:8001/JLMIS/" + str).into(localImageView);
    }
}


/* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/adapter/ActivityNameGoodsListAdapter.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */